﻿<Window x:Class="UbntDiscovery.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Ubnt Discovery" Height="400" Width="800" WindowStartupLocation="CenterScreen" ContentRendered="Window_ContentRendered"    >
    <Window.Resources>
        <Style TargetType="Button" >
            <Setter Property="Padding" Value="10,6"/>
            <Setter Property="Width" Value="60px"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="289*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <DataGrid IsReadOnly="True" Margin="10" Grid.Row="0" HorizontalAlignment="Stretch" ItemsSource="{Binding Devices}" AutoGenerateColumns="False" SelectionMode="Single" CanUserResizeRows="False" CanUserAddRows="False" HorizontalGridLinesBrush="#DDDDDD" VerticalGridLinesBrush="#DDDDDD" HeadersVisibility="Column"  >
            <DataGrid.Columns>
                <DataGridTextColumn Header="Hostname" Width="*" Binding="{Binding Hostname}" />
                <DataGridTextColumn Header="SSID" Width="*" Binding="{Binding SSID}" />
                <DataGridTextColumn Header="Mode" Width="0.5*" Binding="{Binding WirelessModeDescription}" />
                <DataGridTextColumn Header="IP Address" Width="0.9*" Binding="{Binding FirstAddress.IpAddress}" />
                <DataGridTextColumn Header="MAC Address" Width="1.1*" Binding="{Binding FormatedMacAddress}" />
                <DataGridTextColumn Header="Platform" Width="*" Binding="{Binding LongPlatform}" />
                <DataGridTextColumn Header="Firmware" Width="*" Binding="{Binding Firmware}" />
                <DataGridTextColumn Header="Uptime" Width="0.9*" Binding="{Binding Path=Uptime, StringFormat='{}{0:d\\d\\ hh\\:mm\\:ss}' }" />
            </DataGrid.Columns>
        </DataGrid> 

        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,10">
            <Button Content="Scan" Margin="0,0,10,0" Click="ScanClick"/>
            <Button Content="Clear" Margin="0,0,10,0" Click="ClearClick"/>
            <Button Content="Exit" Margin="0,0,0,0"  Click="ExitClick"/>
        </StackPanel>
        
        
    </Grid>
</Window>
